home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / c01oop.zip / CPPWKBK / CPPV2-2.CPP < prev    next >
C/C++ Source or Header  |  1992-08-25  |  458b  |  27 lines

  1. #define HEADER "C++ Problem 2.2 by Rick Conn using Borland C++"
  2.  
  3. #include <stdio.h>
  4.  
  5. class simple {
  6. public:
  7.   simple(); // constructor
  8.   ~simple();  // destructor
  9. };
  10.  
  11. simple::simple() {
  12.   printf("Constructor invoked for object at address %p\n", this);
  13. }
  14.  
  15. simple::~simple() {
  16.   printf("Destructor invoked for object at address %p\n", this);
  17. }
  18.  
  19. void main(void)
  20. {
  21.   printf("%s\n", HEADER);
  22.  
  23.   simple a, b, c;
  24.   simple d;
  25.   simple e;
  26. }
  27.